package com.example.hcbmsm.controller;

import com.example.hcbmsm.domain.Inv;
import com.example.hcbmsm.service.InvService;
import com.example.hcbmsm.util.HCBMSMResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * @author Xinghm
 * @version 1.0
 * @since 2024/11/1 16:41
 */
@RestController
@CrossOrigin
@RequestMapping("/inv")
public class InvController {
    @Autowired
    private InvService invService;

    @GetMapping("/list")
    public Map list(Long drugId, int page, int limit) {
        return invService.list(drugId, page, limit);
    }

    @PostMapping("/inAndOutInv")
    public Map inAndOutInv(String token, @RequestBody Inv inv) {
        return invService.inAndOutInv(token, inv);
    }
}
